import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import {AtTabs,AtTabsPane,AtList,AtListItem} from 'taro-ui'
import app from '../../../../main.js'
import './suifangjihuaren.scss'
import reactMixin from 'react-mixin'
import myJs from './suifangjihuarenJs.js'

export default class Suifangjihuaren extends Component {
    config = {
        navigationBarTitleText: '白内障术后随访计划'
    }
    constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
    init(){
        this.setState({
            current: 0,
        })
    }

    render () {
        return (
            <View className='suifangjihuaren'>
                <AtTabs 
                 tabList={[{title:'进行中'},{title:'已完成'}]}
                 current={this.state.current}
                 onClick={this.handleChange.bind(this,'current')}
                >
                    <AtTabsPane>
                        <AtList className=' class_0'>
                            {
                                this.state.lists.items.map((item,index)=>{
                                    return (
                                        <AtListItem 
                                            key={index}
                                            title={item.patients_id_from_patient_id_name} 
                                            arrow='right' 
                                            note={'开始于'+item.start_date} 
                                            extraText='第3次' 
                                            thumb={app.imageUri+item.patients_id_from_patient_id_head_image}
                                            onClick={this.navigateTo.bind(this,'../suifangjihuaxiangqing/suifangjihuaxiangqing')}
                                        ></AtListItem>
                                    )
                                })
                            }
                        </AtList>
                    </AtTabsPane>
                    <AtTabsPane>
                        <AtList className=' class_1'>
                        {
                                this.state.lists.items.map((item,index)=>{
                                    return (
                                        <AtListItem 
                                            key={index}
                                            title={item.patients_id_from_patient_id_name} 
                                            arrow='right' 
                                            note={'开始于'+item.start_date} 
                                            extraText='第3次' 
                                            thumb={app.imageUri+item.patients_id_from_patient_id_head_image}
                                            onClick={this.navnavigateTo.bind(this,'../suifangjihuaxiangqing/suifangjihuaxiangqing')}
                                        ></AtListItem>
                                    )
                                })
                            }
                        </AtList>
                    </AtTabsPane>
                </AtTabs>
            </View>
        );
    }
}
reactMixin.onClass(Suifangjihuaren,myJs);